//1.父类
public class Animal {
    String name;
    int age;

    //Generate生成构造函数
    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }

    //吃饭函数
    public void eat(){
        System.out.println(this.name + "正在吃饭");
    }

    //Generate自动生成toString函数
    @Override
    public String toString() {
        return "Animal{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

}
